package com.wanghaixin.controller;

import com.wanghaixin.service.TagService;
import com.wanghaixin.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Auther: 王海新
 * @Date: 2020/11/3 19:14
 * @Description: 标签折线图展示层
 */
@Controller
public class EchartsController {

    @Autowired
    private TagService tagService;

    /*********************************************************************************************************************
     * @Author:  王海新
     * @Date:  19:48  2020/11/3
     * @Version:  1.0.0
     * @Description:  折线图
     */
    @ResponseBody
    @RequestMapping("/sys/echarts/line")
    public R findLine(){
        return tagService.findLineData();
    }

    /*********************************************************************************************************************
     * @Author:  王海新
     * @Date:  19:49  2020/11/3
     * @Version:  1.0.0
     * @Description:  柱状图
     */
    @RequestMapping("/sys/echarts/bar")
    @ResponseBody
    public R findBar(){
        return tagService.findBarData();
    }

    /*********************************************************************************************************************
     * @Author:  王海新
     * @Date:  19:49  2020/11/3
     * @Version:  1.0.0
     * @Description:  饼状图
     */
    @RequestMapping("/sys/echarts/pie")
    @ResponseBody
    public R findPie(){
        return tagService.findPieData();
    }
}
